package org.sunsys.qa.web;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ErrorHandler extends HttpServlet {

	public ErrorHandler() {
	}
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		 Throwable throwable = (Throwable)request.getAttribute("javax.servlet.error.exception");
	     Integer statusCode = (Integer)request.getAttribute("javax.servlet.error.status_code");
	     String servletName = (String)request.getAttribute("javax.servlet.error.servlet_name");
	     if (servletName == null){
	    	 servletName = "Unknown";
	     }
	     String requestUri = (String)request.getAttribute("javax.servlet.error.request_uri");
	     if (requestUri == null){
	    	 requestUri = "Unknown";
	     }
	     
		
	}
	
}
